APP = jpeg
OUTPUT_DIR = ~/share/tftpdir/

OBJS = main.o

ARCH = arm-linux-
DEFINE =

CC = $(ARCH)gcc

all: $(APP)
	@echo "Copy \033[31m$(APP)\033[33m ---> \033[32m$(OUTPUT_DIR)\033[0m"
	@cp -raf $(APP) $(OUTPUT_DIR)

$(APP): $(OBJS)
	@echo "Link \033[31m$@\033[33m <--- \033[32m$^\033[0m"
	@$(CC) -Wall -o $@ $^
	
%.o: %.c
	@echo "Make \033[31m$<\033[0m"
	@$(CC) -Wall $(DEFINE) -c -o $@ $<

clean:
	@echo "Clean..."
	@rm -rf $(APP) *.o *.i